In recent years, refactoring has received attention especially in for use in object-oriented languages. See Martin Flower, Refactoring: Improving the design of existing code, Addison Wesley Longman, Inc., 1999, pp. 110-116 (see non-patent document 1, for example). Refactoring can be defined as an operation to improve the internal structure of software while keeping its external behavior. Refactoring is a concept that is also applied to procedural languages such as C and COBOL in addition to object-oriented languages.
While automation of refactoring at a level of renaming classes or methods is presently supported in development environments such as WebSphere Studio for JAVA® and the like, few other types of refactoring are automated, meaning that such refactoring is presently performed using manual operations.
Basic techniques for program analysis include program slicing (see Weiser, M. Program Slicing, IEEE Transactions on Software Engineering, Vol. SE-10, No. 4″, 1984, pp. 352-357 and Takao Shimomura, Program Slicing Technique and Its application to Testing, Debugging and Maintenance, Vol. 33, No. 9, 1992, pp. 1078-1086, for example). Program slicing proposes utilization of data dependence (dependence between a variable in a program and a statement that determines the value of the variable) and control dependence (dependence between a statement in a program and a statement that determines whether the statement will be executed or not) for program analysis.
To perform refactoring, one is required to read source code and understand its operations. It is often necessary to understand the interface information of a program fragment through consideration of external input and output information. One example clearly showing the need to understand the interface information of a program fragment arises in the context of “method extraction” refactoring. A method is a particular meaningful unit that constitutes a program, also called a “sub-routine”. Method extraction refactoring refers to improvement of the internal structure of a program by separating such a method from a program. Of course, the need to understand program fragment interface information is not limited to method extraction refactoring. The information is also useful for program maintenance, re-building, and debugging.
Prior art mechanisms simply consider data dependence and control dependence, and not program fragment interface information.